package tournamentData;

import core.Date;

public class GeneralTournamentInformation {
	String tournamentType = "Turnierart";
	String tournamentName = "TurnierName";
	Date startDate = new Date(13, 13, 13);
	Date endDate = new Date(13, 13, 13);
	String organizer = "Organisation";
	String tournamentLead = "Turnierleitung";
	String referee = "Schiedsrichter";

	public GeneralTournamentInformation(String tournamentType, String tournamentName, Date startDate, Date endDate, String organizer, String tournamentLead, String referee) {
		this.tournamentType = tournamentType;
		this.tournamentName = tournamentName;
		this.startDate = startDate;
		this.endDate = endDate;
		this.organizer = organizer;
		this.tournamentLead = tournamentLead;
		this.referee = referee;
	}

	public String getTournamentType() {
		return this.tournamentType;
	}

	public String getTournamentName() {
		return this.tournamentName;
	}

	public Date getStartDate() {
		return this.startDate;
	}

	public Date getEndDate() {
		return this.endDate;
	}

	public String getOrganizer() {
		return this.organizer;
	}

	public String getTournamentLead() {
		return this.tournamentLead;
	}

	public String getReferee() {
		return this.referee;
	}

	public void setTournamentType(String tournamentType) {
		this.tournamentType = tournamentType;
	}

	public void setTournamentName(String tournamentName) {
		this.tournamentName = tournamentName;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setOrganizer(String operator) {
		this.organizer = operator;
	}

	public void setTournamentLead(String tournamentLead) {
		this.tournamentLead = tournamentLead;
	}

	public void setReferee(String referee) {
		this.referee = referee;
	}

	@Override
	public String toString() {
		StringBuilder output = new StringBuilder();
		output.append(this.tournamentType);
		output.append("\n");
		output.append(this.tournamentName);
		output.append("\n");
		output.append(this.startDate);
		output.append("\n");
		output.append(this.endDate);
		output.append("\n");
		output.append(this.organizer);
		output.append("\n");
		output.append(this.tournamentLead);
		output.append("\n");
		output.append(this.referee);

		return output.toString();
	}

	@Override
	public boolean equals(Object object) {
		if (object instanceof GeneralTournamentInformation) {
			if (((GeneralTournamentInformation) object).getTournamentName().equals(this.getTournamentName())) {
				if (((GeneralTournamentInformation) object).getStartDate().equals(this.getStartDate())) {
					if (((GeneralTournamentInformation) object).getEndDate().equals(this.getEndDate())) {
						if (((GeneralTournamentInformation) object).getOrganizer().equals(this.getOrganizer())) {
							if (((GeneralTournamentInformation) object).getTournamentLead().equals(this.getTournamentLead())) {
								if (((GeneralTournamentInformation) object).getReferee().equals(this.getReferee())) {
									return true;
								}
							}
						}
					}
				}
			}
		}
		return false;
	}
}
